<template>
  <div class="home">
    <div class="gl-chart" ref="glChart"></div>
  </div>
</template>

<script>
import * as echarts from 'echarts/lib/echarts';
import 'echarts-gl'
export default {
  name: 'Home',
  data(){
    return{

    }
  },
  mounted(){
    this.initChart();
  },
  methods:{
    initChart(){
      let newPromise = new Promise((resolve)=>{
        resolve();
      });
      newPromise.then(()=>{
        let data = [];
        let x = 41517729.616;
        let y = 4597358.213;
        let z = - 1248.428;
        let x1 = 41517194.719;
        let y1 = 4597703.723;
        let z1 = - 3973.962;
        data.push([x,y,z]);
        data.push([x1,y1,z1]);
        let glChart = echarts.init(this.$refs.glChart);
        glChart.setOption({
        grid3D: {},
        xAxis3D: {},
        yAxis3D: {},
        zAxis3D: {},
        series:[{
          type:'scatter3D',
          data:data
        }]
        })
      })
    }
  }
}
</script>

<style scoped>
.gl-chart{
  height: 400px;
  width: 400px;
  margin: 0 auto;
}
</style>
